dcmotor28fng 2.2.1
Loading...
Searching...
No Matches
main.c File Reference

DC Motor 28 FNG Click Example. More...

#include "board.h"
#include "log.h"
#include "dcmotor28fng.h"

Macros

#define MIKROBUS_POSITION_DCMOTOR28FNG   MIKROBUS_1

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

DC Motor 28 FNG Click Example.

Description

This example demonstrates the use of the DC Motor 28 FNG Click board. It initializes the Click driver, calibrates the offset for accurate current measurements, and then controls the motor in different states while measuring and logging the output current in milliamps (mA).

The demo application is composed of two sections:

Application Init

Initializes the logger and the DC Motor 28 FNG Click driver and performs offset calibration for current measurements.

Application Task

Controls the motor in a sequence of states: FORWARD, BRAKE, REVERSE, and COAST. In each state, the output current is measured and logged, providing insights into the motor's performance and consumption.

Note
Ensure the PMODE switch is set to position 1 (HIGH), the motor is properly connected to the board OUT1 and OUT2 terminals, and the proper power supply is connected to the input terminal.
Author
Stefan Filipovic

Macro Definition Documentation

◆ MIKROBUS_POSITION_DCMOTOR28FNG

#define MIKROBUS_POSITION_DCMOTOR28FNG   MIKROBUS_1

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )